package com.library.circles.dao;

import com.framework.BaseDao;
import com.library.entity.Circles;
import com.library.entity.Staff;
import org.springframework.stereotype.Repository;

@Repository
public class CirclesDaoImpl extends BaseDao<Circles,String> {

	public Circles findByStaff(Staff staff){
		try{
			return super.findOne("from Circles c where c.staff=?", new Object[]{staff});
		}catch(Exception e){
			e.printStackTrace();
			return null;
		}
	}

	public Circles getCirclesById(Integer circlesId){
		try{
			return super.get(circlesId);
		}catch(Exception e){
			e.printStackTrace();
			return null;
		}
	}


	public void saveCircles(Circles circles){
		try {
			this.save(circles);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	public void updateCircle(Circles circles){
		try {
			this.update(circles);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

	public void deleteCircles(Circles circles){
		try {
			this.delete(circles);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
}
